home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-04-23 | 4.1 KB | 89 lines | [TEXT/GEOL] |
- Item forwarded by A33 to A34
-
- Item 4339690 21-April-90 05:37PDT
-
- From: POWERUP.ENG Power Up Software,PRT
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: RE[∞]- More on external c
-
- Attn: MacApp.Tech$
- SentBy: James Plamondon
- Date 4/20/90
- Subject RE[∞]- More on external cod
- From James Plamondon
- To Kemink, Joost
- CC MacApp.Tech$
-
- Subject: RE[∞]: More on external code
- Dear Joost, et al.,
-
- I am slowly digesting your excellent and informative link on CUST resources in
- Xenon. Please allow me to follow up with a few questions and comments (in no
- particular order).
-
- You mention a problem with CUST resource ID clashes, and the potential for
- problems with resource name clashes. If one assumes that your 'package'
- approach is followed, in which each CUST resource and any support resources it
- requires are all in a single file, with only one CUST resource per file, then
- one might be able to use the file's ioRefNum to uniquely identify the CUST
- package. Would this work?
-
- I'm intrested in knowing some of the nitty-gritty details of your
- implementation, if I may. What kind of header (if any) do your CUST resources
- have? When are they locked down? Are your CUST resources' main routines
- re-entrant? Do they need to be? Do they have any global (or pseudo-global)
- data associated with them? Are they passed an identical parameter block for
- each selector, or does the parameter block vary from selector to selector?
- What are the arguments to the CUST resource's main routine? Does the CUST
- resource request services by calling a single global routine with a service
- selector, or by jumping through a table of service routine pointers? If the
- latter, is a library of glue provided to make the use of this table more
- convenient (e.g., glue like that used when calling PACK resource routines)?
-
- As to callbacks — it is certainly true that the applications using CUST
- resources will vary in their needs. Certainly application-specific callbacks
- will vary from application to application.
-
- However, it may also be true that all CUST resources will make similar demands
- on MacApp itself. A suite of standard MacApp callbacks could be implemented
- as part of the TCust class. The callbacks would certainly include a set of
- support services specific to external code resources, such as asking MacApp to
- creating a view, a menu, a menu item, enable or disable views and/or menu
- items, etc. — all the user interface goodies that a TCust object could do
- directly, but which a code resource would have to do indirectly.
-
- Thus, any descendant of TCust would have access to all of the MacApp's CUST
- callback services. An application would subclass TCust in oder to add its own
- application-specific callback services, and to add methods to TCust that would
- pass messages through to the CUST resource.
-
- The TCust class would also handle the details of keeping the CUST in memory
- when necessary (possibly as defined by a suite of bits in the CUST resource's
- header, as with the DRVR resource's dNeedLock bit), while a TCustManager class
- would search for files containing external code resources of the appropriate
- type, create objects of class TCust to represent those resources found, and so
- on.
-
- You've already dealt with some or all of these issues in your application, I'm
- sure. The point that I'm trying to make is that, although the needs and
- services of external code resources will vary from application to application,
- there's an awful lot that is the same. This similarity makes it worthwhile to
- have a suite of general-purpose, reuseable classes for the handling of
- external code resources. This suite need not be a part of MacApp; they are a
- good opportunity for a third-party developer (as was offscreen drawing,
- yeilding OSImage), or for a Class Room project.
-
- So — what can you tell me about Xenon's implementation of these issues? Are
- you interested in working on such a suite of classes? You certainly seem to
- have more experience using external code resources in MacApp than anyone else
- I know.
-
- Looking forward to hearing from you again, I remain
-
- Yours,
-
- James Plamondon
-
-